using System;
using System.Collections;
using System.Collections.Generic;

using Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response;
using Sinacor.Servico.Bovespa.Cliente.BusinessEntity;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceImplementation.Translator
{
    public static class TranslateBetweenPosicaoContasCorrenteResponseAndPosicaoContasCorrente
    {
        public static DataContract.Response.PosicaoContasCorrenteResponse TranslatePosicaoContasCorrenteToPosicaoContasCorrenteResponse(BusinessEntity.PosicaoContasCorrente from)
        {
            if (from == null) return null;

            DataContract.Response.PosicaoContasCorrenteResponse to = new DataContract.Response.PosicaoContasCorrenteResponse();
            to.DataPosicao = from.DataPosicao;
            to.ContasCorrente = TranslateBetweenContaCorrenteResponseAndContaCorrente.TranslateContaCorrenteListToContaCorrenteResponseList(from.ContasCorrente);
            return to;
        }

        public static BusinessEntity.PosicaoContasCorrente TranslatePosicaoContasCorrenteResponseToPosicaoContasCorrente(DataContract.Response.PosicaoContasCorrenteResponse from)
        {
            if (from == null) return null;

            BusinessEntity.PosicaoContasCorrente to = new BusinessEntity.PosicaoContasCorrente();
            to.DataPosicao = from.DataPosicao;
            to.ContasCorrente = TranslateBetweenContaCorrenteResponseAndContaCorrente.TranslateContaCorrenteResponseListToContaCorrenteList(from.ContasCorrente);
            return to;
        }
    }
}

